<?php

// @formatter:off
/**
 * @file dynamic.conf.skin.php
 * @author Alejandro Dario Simi
 * @date $Date: 2014-05-04 01:33:52 +0000 (Sun, 04 May 2014) $
 *
 * In this file you can find all the general assignments for themes values like
 * name and id of the corrent group, name and id of current directory (if any),
 * etc.
 *
 * This file is included from dynamic.conf.php only when it's running for a web
 * request and not for shell executions.
 *
 * $Id: dynamic.conf.skin.php 111 2014-05-04 01:33:52Z daemonraco@gmail.com $
 * $URL: http://wcomix.googlecode.com/svn/trunk/includes/dynamic.conf.skin.php $
 */
//
// Current group information
WCViewManager::I()->GROUP_ID = $wcGroup ? $wcGroup->id : -1;
WCViewManager::I()->GROUP_NAME = $wcGroup ? $wcGroup->name : "Group Unknown";
//
WCViewManager::I()->ACTION = str_replace(array("/"), ":", $wcAction);
//
// Current user information
if($wcUser) {
	WCViewManager::I()->USER_ID = $wcUser->id();
	//WCViewManager::I()->USER_NAME		= $wcUser->name();
	WCViewManager::I()->USER_USERNAME = $wcUser->username();
	WCViewManager::I()->USER_AVATAR = $wcUser->avatar();
} else {
	WCViewManager::I()->USER_AVATAR = "{$wcDefaults["avatar-basic"]}/no-user.png";
}
//
// Current comic information
if($wcComic) {
	WCViewManager::I()->COMIC_ID = $wcComic->id;
	WCViewManager::I()->COMIC_NAME = $wcComic->name;
	if($wcComic->next_name) {
		WCViewManager::I()->COMIC_NEXT_NAME = $wcComic->next_name;
	}
}
//
// Current image information
if($wcImage) {
	WCViewManager::I()->IMAGE_ID = $wcImage->id;
	WCViewManager::I()->IMAGE_NAME = $wcImage->name;
	if($wcImage->next_name) {
		WCViewManager::I()->IMAGE_NEXT_NAME = $wcImage->next_name;
	}
}
//
// Current directory information
if($wcDirectory) {
	WCViewManager::I()->DIRECTORY_ID = $wcDirectory->id;
	WCViewManager::I()->DIRECTORY_NAME = $wcDirectory->name;
	WCViewManager::I()->DIRECTORY_COUNT = $wcDirectory->count;
	WCViewManager::I()->DIRECTORY_ICOUNT = $wcDirectory->icount;
	WCViewManager::I()->DIRECTORY_DCOUNT = $wcDirectory->dcount;
	if($wcDirectory->next_name) {
		WCViewManager::I()->DIRECTORY_NEXT_NAME = $wcDirectory->next_name;
	}
}
//
// Current tag information
if($wcTag) {
	WCViewManager::I()->TAG_ID = $wcTag->id;
	WCViewManager::I()->TAG_NAME = $wcTag->name;
	WCViewManager::I()->TAG_COUNT = $wcTag->count;
	WCViewManager::I()->TAG_ICOUNT = $wcTag->icount;
}
//
// Current collection information
if($wcCollection) {
	WCViewManager::I()->COLLECTION_ID = $wcCollection->id;
	WCViewManager::I()->COLLECTION_NAME = $wcCollection->name;
	WCViewManager::I()->COLLECTION_COUNT = $wcCollection->count;
	WCViewManager::I()->COLLECTION_SUBCOUNT = $wcCollection->subcount;
}
//
// Current rule information
if($wcRule) {
	WCViewManager::I()->RULE_ID = $wcRule->id;
	WCViewManager::I()->RULE_NAME = $wcRule->name;
	WCViewManager::I()->RULE_COUNT = $wcRule->count;
	if($wcRuleAction) {
		WCViewManager::I()->RULE_ACTION_ID = $wcRuleAction->id();
		WCViewManager::I()->RULE_ACTION_NAME = $wcRuleAction->name();
	}
}
//
// Setting general assignments.
// @{
WCViewManager::I()->VERSION_NAME = $wcVersions["name"];
WCViewManager::I()->VERSION_VERSION = $wcVersions["version"];
WCViewManager::I()->VERSION_JQUERY = $wcVersions["jquery"];
WCViewManager::I()->VERSION_JQUERYUI = $wcVersions["jqueryui"];
WCViewManager::I()->SITE_NAME = $wcSite["name"];
WCViewManager::I()->SITE_EMAIL = $wcSite["email"];
WCViewManager::I()->SITE_URI = $wcROOTURI;
WCViewManager::I()->SKIN = defined("__MOBILE__") ? $wcDefaults["skin-mobile"] : $wcDefaults["skin"];
WCViewManager::I()->SKIN_URI = "{$wcPaths["mvc"]["skins-uri"]}/".WCViewManager::I()->SKIN;
if($wcSite["wiki"]) {
	WCViewManager::I()->SITE_WIKI = $wcSite["wiki"];
}
if($wcDefaults["read-only"]) {
	WCViewManager::I()->READ_ONLY = true;
}
//
// Others
// @{
WCViewManager::I()->NO_PREVIEW_URI = $wcDefaults["preview"];
// @}
//
// Cache flags
if(isset($_REQUEST["nolang"])) {
	$_REQUEST["nocache"] = true;
}
if(isset($_REQUEST["nocache"])) {
	$wcSkinDefaults["cache"]["active"] = false;
}
// @}
?>